package cn.bytets.rpc.api;

import cn.bytets.rpc.api.message.Request;

import java.net.InetSocketAddress;

public interface Channel {

    /**
     * send message.
     *
     * @param message
     * @throws
     */
    void send(Object message);

    /**
     * get local address.
     *
     * @return local address.
     */
    InetSocketAddress getLocalAddress();

    /**
     * close the channel.
     */
    void close();

    /**
     * is closed.
     *
     * @return closed
     */
    boolean isClosed();

    void setRequest(Request request);

    Request getRequest();
}
